public partial class Staff : Form
    {
        public Staff()
        {
            InitializeComponent();
        }

        private void Staff_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'stafScheDataSet.Staff' table. You can move, or remove it, as needed.
            this.staffTableAdapter.Fill(this.stafScheDataSet.Staff);
            // TODO: This line of code loads data into the 'stafScheDataSet.Staff' table. You can move, or remove it, as needed.
            this.staffTableAdapter.Fill(this.stafScheDataSet.Staff);

        }

        private void dataGridView1_RowValidated(object sender, DataGridViewCellEventArgs e)
        {
            this.staffTableAdapter.Update(this.stafScheDataSet.Staff);
        }

        private void Staff_Activated(object sender, EventArgs e)
        {
            //MessageBox.Show("act");
            if (string.IsNullOrEmpty(uc.User))
            {
                bindingNavigator1.Enabled = false;
                dataGridView1.ReadOnly = true;
            }
            else
            {
                bindingNavigator1.Enabled = true;
                dataGridView1.ReadOnly = false;
            }
        }

        private void dataGridView1_DataError(object sender, DataGridViewDataErrorEventArgs e)
        {
            MessageBox.Show(e.Exception.Message);
        }
    }
